package ua.kyivenergo.cableLines.search;

/**
 * Created by Alex Kebkalo (kebka@mail.ru) on 22.04.14.
 */
public class SearchComparator {
    static private final int MIN_LENGTH = 3;

    static public double compareStrings(String baseString, String searchString) {
        baseString = baseString.toUpperCase();
        searchString = searchString.toUpperCase();
        if (baseString.equals(searchString)) {
            return 1;
        }
        if ((searchString.length()>=MIN_LENGTH) && baseString.contains(searchString)) {
            return 0.5;
        }
        return 0;
    }
}
